package com.mongo.data.enums;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

public enum NodeStatus {
    VIDEO("VIDEO","多路视频回放"),
    PERCEPTION("PERCEPTION","感知视频回放"),
    FUSE("FUSE","融合视频回放"),
    PERFORMANCE("PERFORMANCE","性能解析"),
    TOPIC("TOPIC","topic解析"),
    GENERAL("GENERAL","通用解析"),
    PREPROCESS("PREPROCESS","数据预处理"),
    UPLOAD("UPLOAD","上传任务");

    @Getter
    private String name;
    @Getter
    private String desc;

    NodeStatus(String name, String desc) {
        this.name=name;
        this.desc=desc;
    }

    public String getName()
    {
        return name;
    }

    public String getDesc() {
        return desc;
    }

    private static Map<String, NodeStatus> nodeStatusMap = new HashMap<>();

    static {
        for (NodeStatus nodeStatus : NodeStatus.values()) {
            nodeStatusMap.put(nodeStatus.name, nodeStatus);
        }
    }

    public static NodeStatus toEnum(String name) {
        return nodeStatusMap.get(name);
    }

}
